public class bk {

	public short d;
	public short e;
	public short f;
	public short g;

	public bk() {
	}

	public bk(int i, int j, int k, int l) {
		d = (short) i;
		e = (short) j;
		f = (short) k;
		g = (short) l;
	}

	public String toString() {
		StringBuffer stringbuffer;
		(stringbuffer = new StringBuffer(20)).append('[');
		stringbuffer.append(d);
		stringbuffer.append(',');
		stringbuffer.append(e);
		stringbuffer.append(' ');
		stringbuffer.append(f);
		stringbuffer.append(',');
		stringbuffer.append(g);
		stringbuffer.append(']');
		return stringbuffer.toString();
	}

	public final boolean a(int i, int j) {
		return d <= i && i < d + f && e <= j && j < e + g;
	}

	public final boolean a(int i, int j, int k, int l) {
		int i1 = f;
		int j1 = g;
		if (k <= 0 || l <= 0 || i1 <= 0 || j1 <= 0)
			return false;
		short word0 = d;
		short word1 = e;
		k += i;
		l += j;
		i1 += word0;
		j1 += word1;
		return (k < i || k > word0) && (l < j || l > word1)
				&& (i1 < word0 || i1 > i) && (j1 < word1 || j1 > j);
	}

	public final bk a() {
		return new bk(d, e, f, g);
	}

	public final void a(bk bk1) {
		d = bk1.d;
		e = bk1.e;
		f = bk1.f;
		g = bk1.g;
	}

	public final void b(int i, int j, int k, int l) {
		d = (short) i;
		e = (short) j;
		f = (short) k;
		g = (short) l;
	}

	public final void b() {
		d = e = f = g = 0;
	}

	public final int c() {
		return d + f;
	}

	public static boolean a(int i, bk bk1, bk bk2) {
		boolean flag = false;
		switch (i) {
		case 3: // '\003'
		case 4: // '\004'
		default:
			break;

		case 1: // '\001'
			if (bk1.e < bk2.e)
				return false;
			flag = true;
			break;

		case 6: // '\006'
			if (bk1.e > bk2.e)
				return false;
			flag = true;
			break;

		case 2: // '\002'
			if (bk1.d < bk2.d)
				return false;
			break;

		case 5: // '\005'
			if (bk1.d > bk2.d)
				return false;
			break;
		}
		int j = flag ? ((int) (bk1.f)) : ((int) (bk1.g));
		int k = flag ? ((int) (bk2.f)) : ((int) (bk2.g));
		if (j <= 0 || k <= 0)
			return false;
		short word0 = flag ? bk1.d : bk1.e;
		short word1 = flag ? bk2.d : bk2.e;
		j += word0;
		k += word1;
		return (j < word0 || j > word1) && (k < word1 || k > word0);
	}
}